ZennoLab Assemblies Documentation
AddRange(HtmlElement[]) Method
Example 

Type: Zennolab.CommandCenter.HtmlElementCollection[]

The array whose html elements should be added to the end of the HtmlElementCollection. The collection itself cannot be null.

Adds the htm elements of the specified array to the end of the HtmlElementCollection.
Syntax
public void AddRange( 
   HtmlElement[] elements
)

Parameters

elements

Type: Zennolab.CommandCenter.HtmlElementCollection[]

The array whose html elements should be added to the end of the HtmlElementCollection. The collection itself cannot be null.

Remarks
The order of the elements in the collection is preserved in the HtmlElementCollection.
Example
The following code example demonstrates the AddRange method and various other methods of the HtmlElementCollection class that act on ranges.The AddRange method is called, with the array as its argument. The result is that the current elements of the list are added to the end of the list, duplicating all the elements.
public static int Execute(Instance instance, IZennoPosterProjectModel project)
{
    // clear cookie
    instance.ClearCookie();
    
    // go to lessons.zennolab.com
    Tab tab = instance.MainTab;
    if ((tab.IsVoid) || (tab.IsNull)) return -1;
    if (tab.IsBusy) tab.WaitDownloading();
    tab.Navigate("lessons.zennolab.com");
    if (tab.IsBusy) tab.WaitDownloading();
    
    // find elements by tag
    HtmlElementCollection heCol = tab.FindElementsByTags("input:checkbox");
    
    // find elements by tag
    HtmlElementCollection newHeCol = tab.FindElementsByTags("input:radio");
    
    // add second collection to first
    heCol.AddRange(newHeCol.Elements);
    
    return 0;
}
public static function Execute($instance, $project)
{
    // clear cookie
    $instance->ClearCookie();
    
    // go to lessons.zennolab.com
    $tab = $instance->MainTab;
    if (($tab->IsVoid) || ($tab->IsNull)) return -1;
    if ($tab->IsBusy) $tab->WaitDownloading();
    $tab->Navigate("lessons.zennolab.com");
    if ($tab->IsBusy) $tab->WaitDownloading();
    
    // find elements by tag
    $heCol = $tab->FindElementsByTags("input:checkbox");
    
    // find elements by tag
    $newHeCol = $tab->FindElementsByTags("input:radio");
    
    // add second collection to first
    $heCol->AddRange($newHeCol);
    
    return 0;
}
Requirements

Target Platforms: Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows Seven

See Also

Reference

HtmlElementCollection Class
HtmlElementCollection Members
Overload List
HtmlElement Class
Add Method
Insert Method
InsertRange Method

Send Feedback